<template>
  <van-tabbar v-model="currentIndex">
    <van-tabbar-item v-for="item in tabbarData" replace :to="item.path"
                     :icon="item.icon">
      {{ item.title }}
    </van-tabbar-item>
  </van-tabbar>
</template>
<script setup>
import { ref } from 'vue';
import { useRoute,useRouter } from "vue-router";
import runningO from '../assets/running-o.png'
import courseO from '../assets/course-o.png'
const tabbarData = [
  {
    title:'首页',
    icon: 'home-o',
    path: '/home'
  },
  {
    title:'课程',
    icon: courseO,
    path: '/course'
  },
    {
    title:'跑步',
    icon: runningO,
    path: '/running'
  },
  {
    title:'商城',
    icon: 'cart-o',
    path: '/mall'
  },
  {
    title:'个人',
    icon: 'setting-o',
    path: '/message'
  }
]
const currentIndex = ref(0)
const itemClick = (index) => {
  currentIndex.value = index
}
</script>
<style lang="less" scoped>
</style>
